<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>话费月月领</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    a {
        text-decoration: none;
    }

    html {
        font-size: 16px;
        background-color: #4c63f1;
    }

    /* 提示框 */
    .am-toast {
        position: fixed;
        width: 100%;
        z-index: 2999;
        font-size: 14px;
        text-align: center;
    }

    .am-toast>span {
        max-width: 80%;
    }

    .am-toast.am-toast-mask {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        left: 0;
        top: 0;
        transform: translateZ(1px);
    }

    .am-toast-notice-content {
        min-width: 160px;
        border-radius: 3px;
        color: #fff;
        background-color: rgba(58, 58, 58, 0.9);
        line-height: 1.5;
        padding: 9px 15px;
    }

    /* ---------------------------------提示框 */

    .header .content {
        width: 100%;
        height: 12rem;
        position: relative;
    }

    .header .content img {
        width: 100%;
        height: 100%;
    }

    .header .content .title1 {
        width: 100%;
        text-align: center;
        font-size: 2.2rem;
        font-weight: bold;
        color: white;
        position: absolute;
        top: 6.7rem;
    }
    .header .content .title2{
        width: 100%;
        text-align: center;
        font-size: 0.7rem;
        color: white;
        position: absolute;
        top: 10rem;
        opacity: 0.7;
    }

    .main .content {
        width: 100%;
        position: relative;
    }

    .main .content .payment {
        position: relative;
    }

    .main .content .payment .pay {
        width: 100%;
        height: 17rem;
        position: relative;
    }

    .main .content .payment .pay img {
        width: 100%;
        height: 100%;
    }

    /* .main .content .payment .pay input {
        position: absolute;
        width: 86%;
        height: 3rem;
        left: 1.5rem;
        top: 1rem;
        border-radius: 10rem;
        outline: none;
        background-color: #9c5cce;
    } */

    .main .content .payment .text {
        width: 90%;
        height: 3rem;
        font-size: 0.8rem;
        position: absolute;
        top: 9rem;
        left: 1.5rem;
    }

    .main .content .payment .text p {
        line-height: 1.2rem;
    }

    .main .content .payment .text p span:nth-child(1) {
        color: #15a2ea;
    }

    .main .content .payment .text p span:nth-child(2) {
        color: gray;
        font-size: 0.7rem;
        margin-left: 1rem;
        text-decoration: line-through;
    }

    .main .content .payment button {
        width: 15.6rem;
        height: 3rem;
        position: absolute;
        bottom: 2.2rem;
        left: 3.9rem;
        border-radius: 10rem;
        opacity: 0;
    }

    .main .content .payment .illustrate {
        width: 100%;
        height: 2rem;
        line-height: 2rem;
        position: absolute;
        bottom: 0.1rem;
        font-size: 0.7rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .main .content .payment .illustrate .agree{
        margin-right: 0.2rem;
    }

    .main .content .list {
        width: 100%;
        height: 10rem;
        position: relative;
        padding-top: 2.5rem;
        background: linear-gradient(to bottom, #9c5cce, #3d65f8);
    }

    .main .content .list .icon {
        width: 12rem;
        height: 2rem;
        margin: auto;
        position: absolute;
        left: 5.5rem;
        top: 1.8rem;
    }

    .main .content .list .icon img {
        width: 100%;
        height: 100%;
    }

    .main .content .list .contlist {
        width: 95%;
        margin: auto;
        padding-top: 2rem;
        padding-bottom: 1rem;
        border-radius: 0.5rem;
        background-color: #d8e8f8;
        height: 1000px;
    }

    .main .content .list .contlist .top {
        width: 95%;
        height: 6rem;
        margin: auto;
    }

    .main .content .list .contlist .top img {
        width: 100%;
        height: 100%;
    }

    .footer .content {
        z-index: 999;
        margin-top: 900px;
        color: white;
        line-height: 1.4rem;
        font-size: 0.8rem;
        padding: 0.8rem;
        background: url("static/images/bottom_bg.jpg")no-repeat 0 0/100% 100%;
    }

    .input-box {
        width: 100%;
        position: absolute;
        top: 1.2rem;
        text-align: center;
        z-index: .4rem;
    }

    .input-box input {
        height: 3rem;
        border-radius: .4rem;
        text-align: center;
        font-size: 1.3rem;
        border: none;
        outline: none;
        background-color: transparent;
    }

    .hfsm {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: .6rem;
    }

    .gs-box {
        color: #fff;
        text-align: center;
        margin-bottom: .5rem;
        font-size: 12px;
        margin-top: 30px;

    }

    .djhy {
        color: #fed100
    }
</style>

<body>
    <div class="wrap">
        <div class="header">
            <div class="content">
                <img src="./image/top_bg.jpg" alt="">
                <p class="title1"><span>充49.9元得</span><span class="djhy">100话费</span></p>
                <p class="title2">
                    <span>支付成功即可领取</span>
                    <span class="djhy">10元</span>
                    <span>次月起每月可领取10元，共10个月</span>
                </p>
            </div>
        </div>
        <div class="main">
            <div class="content">
                <div class="payment">
                    <div class="pay">
                        <img src="./image/pay_bg.jpg">
                        <div class="input-box">
                            <input type="tel" id="textphone" maxlength="11" placeholder="请输入手机号码领取" />
                        </div>
                    </div>
                    <div class="text">
                        <p>实际支付金额:<span>49.9</span> <span>原价100元</span></p>
                        <p>实际到账总话费:<span>100元</span></p>
                    </div>
                    <!-- <div class="btn pay_phone_number_button" @click="login"> -->
                    <button class="pay_phone_number_button" id="xiadan">立即支付</button>

                    <!-- <button id="xiadan">立即支付</button> -->
                    <label class="illustrate">
                        <input class="agree" type="checkbox" id="check" checked>
                        <span>我已同意并阅读《话费礼包说明》</span>
                    </label>
                </div>
                <div class="list">
                    <div class="icon">
                        <img src="./image/top_icon.png" alt="">
                    </div>
                    <div class="contlist">
                        <div class="top">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                            <img src="./image/huafei1.png" alt="">
                        </div>
                        <div class=""></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="footer">

            <div class="content">
                <div class="hfsm">《话费礼包说明》</div>
                <p>
                    1.100元话费每个月可领取10元话费，需要在每个周期(默认为月)进行手动兑换，举例:在1月5号购买成功，1月5日至2月4日为第一个兑换间期，2月5日至3月4日为第二个领取周期，以此类推;<br>
                    2.每个周期内可随时兑换话费,若某周期未兑换,则视为主动放弃该次领取资格，后续不做补发;<br>
                <p></p>
                3.领取方法：微信关注【惠话月享】，即可参与活动，话费领取时间段以首次充值计算或注意短信接收，点击短信里的链接也可进行充值<br>
                4.兑换话费时需输入抢购时的手机号，即可充值到账(一般1~10分钟内充值成功);<br>
                5.注:部分携号转网号码可能导致充值不成功! <br>
                6.本公司拥有对上述条款做最终解释的权利: <br>
                </p>
            </div>
        </div>
        <div class="gs-box">
            <div class="gs-name"></div>
            <div class="gsmc">北京数慧生活科技有限公司</div>
            <div class="banh">京ICP备2022030573号-9</div>
            <div class="kfdh">客服电话：<span class="tel">010-53396307</span> </div>
        </div>

    </div>
</body>

</html>
<script src="./js/fingerprint2.min.js"></script>
<script src="./js/jquery.min.js"></script>
<script src="./js/base64.min.js"></script>
<script src="./js/dayjs.min.js"></script>
<!-- <script src="./js/jquery.cookie.min.js"></script> -->
<script src="./js/pingpp.js"></script>
<!-- <script src="./js/index.js"></script> -->

    <!-- <script src="./js/flexible.js"></script> -->
    <script src="./js/vue.min.js"></script>
    <script src="./js/jquery-2.1.0.js"></script>
    <script src="./js/base64.js"></script>
    <script src="./js/config.js"></script>

<script>
 // VConsole 默认会挂载到 `window.VConsole` 上
//   var vConsole = new window.VConsole();
  
    //获取url参数
    function getUrlParams(index = '') {
        const params = {};
        const url = window.location.href;
        const urlObj = new URL(url);
        for (const [key, value] of urlObj.searchParams.entries()) {
            if(index && index === key){
                return value;
            }
            params[key] = value;
        }
        return params;
    }

    $(function (){
        //判断来源
        let params = getUrlParams();
        let source = '';
        let sourceLicense = '';

        if(params['qcjParamStr']){
            source = 'qcjParamStr';
            sourceLicense = params['qcjParamStr'];
        }else if(params['bxm_id']){
            source = 'bxmid';
            sourceLicense = params['bxm_id'];
        }else if(params['a_oId']){
            source = 'tuia';
            sourceLicense = params['a_oId'];
        }

        if(params['phone']){
            let phone = atob(params['phone']);
            if(phone){
                $("#textphone").val(phone);
            }
        }

        $('.pay_phone_number_button').on('click', function () {
            let phone = $('#textphone').val();
            var regex = /^1\d{10}$/;
            if(! regex.test(phone)){
                alert("请输入正确的手机号");
                return false;
            }

// console.log('111');
// console.log(source);
// return

            // 获取token
            // $.ajax({
            //     type : 'POST',
            //     url : domain + '/api/pb/createTokenHf',
            //     data : {
            //         phone: phone
            //     },
            //     success : function (res) {
            //         code = res;
            //         $.ajax({
            //             type : 'POST',
            //             url : domain + '/api/pb/setOrder',
            //             data : {
            //                 phone: $('#textphone').val(),
            //                 // phone: phone,
            //                 source: source,
            //                 sourceLicense: sourceLicense,
            //                 token: code
            //             },
            //             success : function (res) {
            //                 if(res.code === 1){
            //                     location.href = res.data.url;
            //                 }else{
            //                     alert(res.msg);
            //                 }
            //             }
            //         });


            //     }
            // });


            $.ajax({
                type : 'POST',
                url : domain + '/api/pb/setOrder',
                data : {
                    phone: phone,
                    source: source,
                    sourceLicense: sourceLicense
                },
                success : function (res) {
                    if(res.code === 1){
                        location.href = res.data.url;
                    }else{
                        alert(res.msg);
                    }
                }
            });
        });
    })
</script>
